﻿package velbus
{
	import flash.events.Event;
	import velbus.Packet;
	
	public class VelbusEvent extends Event 
	{
	
		public static const PACKET_RECEIVED:String = "PACKET_RECEIVED";
		public static const CONNECTED:String = "CONNECTED";
		public static const SCAN_COMPLETE:String = "ScanComplete";
		
		public var packet:Packet;
		
		public function VelbusEvent(type_:String, packet_:Packet = null, bubbles:Boolean=false, cancelable:Boolean=false) 
		{ 
			super(type_, bubbles, cancelable);
			packet = packet_;
		} 
		
		public override function clone():Event 
		{ 
			return new VelbusEvent(type, packet, bubbles, cancelable);
		} 
		
		public override function toString():String 
		{ 
			return formatToString("VelbusEvent type: " + type + " - Packet: " + packet ); 
		}
		
	}
	
}